traverse node 指定元素 (補)


Posted by mijouhsieh on 2023-03-03

:nth-child MDN
.children以外, :nth-child更精確的指定元素

document.querySelector('.static-board tr > td:nth-child(1)').innerText

最後附上HTMLElement & Element的文件供你參考(HTMLElement繼承了Element, 所以包含了Element所有的屬性)

HTMLElement MDN
Element MDN


#Node #:nth-child( )







Related Posts

用 ES6 語法串接 API - Fetch

用 ES6 語法串接 API - Fetch

Return first capital letter and its index

Return first capital letter and its index

[進階 js 06] 體驗 JS 引擎的一天,理解 Execution Context 與 Variable Object

[進階 js 06] 體驗 JS 引擎的一天,理解 Execution Context 與 Variable Object


Comments